/*
 * support linear map for stm32 pinctrl irqchip
 *
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023.
 * Description: support linear map for stm32 pinctrl irqchip
 * Author: liuwenliang@huawei.com
 * Create: 2023-10-17
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */
#ifndef LINEAR_FOR_STM32_PINCTRL_H
#define LINEAR_FOR_STM32_PINCTRL_H

#include <linux/irqdomain.h>
#include <uapi/asm-generic/errno.h>

#ifdef CONFIG_RTOS_HAL_LINEAR_MAP
#ifdef CONFIG_PINCTRL_STM32
extern int stm32_gpio_irqchip_find_linear_hwirq(struct irq_domain *domain,
	irq_hw_number_t hwirq, irq_hw_number_t *linear_hwirq);
#else
static int stm32_gpio_irqchip_find_linear_hwirq(struct irq_domain *domain,
	irq_hw_number_t hwirq, irq_hw_number_t *linear_hwirq)
{
	return -EOPNOTSUPP;
}
#endif
#endif

#endif /* LINEAR_FOR_STM32_PINCTRL_H */
